package main

import (
	"flag"
	"fmt"
)

//接收命令行输入的参数，如：登录mysql：musqld -u root -p 111
func main() {
	var user string
	var pwd string
	var host string
	var IP string

	flag.StringVar(&user, "u", "", "用户名，默认为空")
	flag.StringVar(&pwd, "p", "", "用户密码，默认为空")
	flag.StringVar(&host, "h", "", "端口，默认为空")
	flag.StringVar(&IP, "a", "", "ip地址，默认为空")

	flag.Parse()

	fmt.Println(user, pwd, host, IP)
}
